# coding:utf-8
# author:frank
# date:2024/12/28
class Animal:
    def __init__(self,name,age,sex,health,price):
        self.name=name
        self.age=age
        self.sex=sex
        self.health=health
        self.price=price
class Pet:
    animals=[]
    def find(self,name):
        isFound=False
        for p in self.animals:
            pos = p.name.find(name)
            if pos>-1:
                isFound=True
                print("-----------------")
                print("宠物名称：",p.name)
                print("宠物年龄：", p.age)
                print("健康情况：", p.health)
        if not isFound:
            print("没有宠物信息")

class Shop(Pet):
    def sale(self):
        print("-------宠物列表-------")
        for i,p in enumerate(self.animals):
            print("宠物编号：",i)
            print("宠物名称：", p.name)
            print("宠物年龄：", p.age)
            print('-------------------')
        index = int(input("请选择要购买的宠物编号："))
        print("出售成功：",self.animals[index].name)
    def up(self):
        pass
    def down(self):
        pass
class Hospital(Pet):
    def pay(self):
        pass
    def doctor(self):
        pass

# 宠物集团初始化两条动物信息
Pet.animals.append(Animal('小黄',2,'公','良好',300))
Pet.animals.append(Animal('小红',3,'母','良好',380))

# 医院查询宠物信息
# Hospital().find("小")
# 商店出售宠物
Shop().sale()